package cn.zswltech.gruul.biz.service.impl;

import cn.zswltech.gruul.biz.service.OperationLogService;
import cn.zswltech.gruul.common.dal.query.OperationLogQuery;
import cn.zswltech.gruul.common.result.Response;
import cn.zswltech.lib.futurelog.save.model.cmd.FutureLogQueryCmd;
import cn.zswltech.lib.futurelog.save.model.vo.FutureLogVO;
import cn.zswltech.lib.futurelog.save.service.FutureLogService;
import cn.zswltech.lib.futurelog.save.util.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author pengfei.yu
 * @date 2024/2/22 18:14
 */
@Slf4j
@Service
public class OperationLogServiceImpl implements OperationLogService {

    @Resource
    private FutureLogService futureLogService;

    /**
     * 操作日志查询
     */
    @Override
    public Response<Page<FutureLogVO>> logPageList(OperationLogQuery qry) {
        log.info("操作日志查询-->{}", qry);

        FutureLogQueryCmd queryCmd = new FutureLogQueryCmd(qry.getPage(), qry.getPageSize(), qry.getOpUser(), qry.getMenu(), qry.getStart(), qry.getEnd());
        Page<FutureLogVO> page = futureLogService.queryByCondition(queryCmd);

        return Response.success(page);
    }
}
